Estoy creando una aplicación React Native usando la plataforma Expo . Tengo una base de datos SQLite conectada para poder trabajar con la aplicación sin conexión a Internet. Aquí está mi código: (puede usar mi enlace github para probar el programa)
downloadDB = () => { let fileUri = `${FileSystem.documentDirectory}SQLite/qr.db`; //The place I download my .db file to const uri = "https://github.com/iliapnmrv/iliapnmrv.github.io/blob/02dfac2080ec9d7efdc0f131abfb52de36f88c2d/inventory/qr.db" // An external link FileSystem.downloadAsync(uri, fileUri) .then(({ uri, status }) => { console.log(`Download status: ${status}`) // code always displays status code 200 db.transaction( tx => { tx.executeSql( 'SELECT * FROM qr', [], (_, result) => { console.log(`QR table has ${result.rows.lengs} rows`) }, (_, error) => { console.log(`Error code 1: ${error}`) } ); } ); }) .catch(err => { console.error(`Error code 7: ${err}`); }); }Y aquí están todas las consolas, devoluciones de aplicaciones:
Download status: 200 Error code 1: Error: no such table: qr (code 1 SQLITE_ERROR[1]): , while compiling: SELECT * FROM qrPor favor ayudame a resolver este problema.